package com.dc.designPattern._13_command.impl;

/**
 * Description: 命令模式_命令实现_电视打开命令
 * @author: gdc
 * @date: 2021/4/20
 * @version 1.0
 */
public class TvOnCommand implements Command{

    /**
     * 聚合电视接收者
     */
    private TvReceiver tvReceiver;

    public TvOnCommand(TvReceiver tvReceiver) {
        this.tvReceiver = tvReceiver;
    }

    @Override
    public void execute() {
        tvReceiver.on();
    }

    @Override
    public void undo() {
        tvReceiver.off();
    }
}
